load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rttanalysis",
    srcs = [
        "cluster.go",
        "registry.go",
        "rtt_analysis_bench.go",
        "testing_shims.go",
        "validate_benchmark_data.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/bench/rttanalysis",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/sql",
        "//pkg/sql/parser",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/util/log",
        "//pkg/util/metamorphic",
        "//pkg/util/quotapool",
        "//pkg/util/syncutil",
        "//pkg/util/system",
        "//pkg/util/tracing/tracingpb",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)

go_test(
    name = "rttanalysis_test",
    size = "large",
    srcs = [
        "alter_table_bench_test.go",
        "audit_bench_test.go",
        "bench_test.go",
        "create_alter_role_bench_test.go",
        "discard_bench_test.go",
        "drop_bench_test.go",
        "generate_objects_bench_test.go",
        "grant_revoke_bench_test.go",
        "grant_revoke_role_bench_test.go",
        "jobs_test.go",
        "orm_queries_bench_test.go",
        "rtt_analysis_test.go",
        "system_bench_test.go",
        "truncate_bench_test.go",
        "udf_resolution_test.go",
        "validate_benchmark_data_test.go",
        "virtual_table_bench_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":rttanalysis"],
    exec_properties = {"test.Pool": "large"},
    deps = [
        "//pkg/base",
        "//pkg/jobs/jobspb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
    ],
)
